/* ========================================================================= */
/* ------------------------------------------------------------------------- */
/*!
  \file			objdeflib.h
  \date			Feb 2012
  \author		TNick

  \brief		Contains definitions for the objects library


*//*


 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Please read COPYING and README files in root folder
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
#ifndef __OBJDEFLIB_INC__
#define __OBJDEFLIB_INC__
//
//
//
//
/*  INCLUDES    ------------------------------------------------------------ */

#include	<QDebug>
#include	<QtCore/QtGlobal>

/*  INCLUDES    ============================================================ */
//
//
//
//
/*  DEFINITIONS    --------------------------------------------------------- */


/* a simple result system for functions that allow warnings, too */
#ifndef	OUT_SUCCESS


/**
*	@brief	describes the result of a function
*/
enum	OUTCOME			{
	OUTCOME_WARNING = -1,
	OUTCOME_OK = 0,
	OUTCOME_ERROR = 1
};

/**
*	@brief	tests the result for success (warnings included)
*/
#define		OUT_SUCCESS( o )	( o != OUTCOME_ERROR )

/**
*	@brief	tests the result for success (warnings excluded)
*/
#define		OUT_FULL_SUCCESS( o )	( o == OUTCOME_OK )

#endif






/* used to export functions when in library mode */
#if defined(EXPORT_OBJECTSLIB)
#  define		EXPORT Q_DECL_EXPORT
#else
#  define		EXPORT Q_DECL_IMPORT
#endif




/* simple system to allow other systems than UserMsg */
#if defined(USE_USERMSG)
#	define	ERROR_REPORT(um,msg)	um.add( UMSG::MSG_ERROR, msg)
#	define	DEBUG_REPORT(um,msg)	um.add( UMSG::MSG_DBG_ERROR, msg)
#else
#	define	ERROR_REPORT(um,msg)	qDebug() << "ERROR!!! " << msg;
#	define	DEBUG_REPORT(um,msg)	qDebug() << "DEBUG: " << msg;
#endif


/* this allows customisation of the name of the UserMsg class for error report */
#ifndef	UMSG
#	define	UMSG	UserMsg
#endif


namespace	ObjD	{

class	Session;


/*  DEFINITIONS    ========================================================= */
//
//
//
//
/*  DATA    ---------------------------------------------------------------- */

/*  DATA    ================================================================ */
//
//
//
//
/*  FUNCTIONS    ----------------------------------------------------------- */




	/**
	*	@brief	 Initialisation of the library
	*/
	EXPORT void				initialise				( void );


	/**
	*	@brief	 Un-initialisation of the library
	*/
	EXPORT void				terminate				( void );




	/**
	*	@brief	 Creates a new session
	*/
	EXPORT Session*			createSession			( void );


	/**
	*	@brief	 Deletes a session; fails if it is the current session
	*/
	EXPORT void				deleteSession			( Session * targ_ss );


	/**
	*	@brief	 Changes the current session
	*/
	EXPORT void				makeSessionCurrent		( Session * targ_ss );


	/**
	*	@brief	 reports current session
	*/
	EXPORT Session *		currentSession			( void );


}	//	namespace	ObjD


/*  FUNCTIONS    =========================================================== */
//
//
//
//
#endif // __OBJDEFLIB_INC__
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
